<template>
  <div class="main">
    <Home v-if="active == 'home'"></Home>
    <List v-if="active == 'list'"></List>
    <ShoppingCart v-if="active == 'friends'"></ShoppingCart>
    <UserLogin v-if="active == 'setting'"></UserLogin>
    <van-tabbar v-model="active" @change="onChange">
      <van-tabbar-item name="home" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item name="list" icon="apps-o">分类</van-tabbar-item>
      <van-tabbar-item name="friends" icon="cart-o">购物车</van-tabbar-item>
      <van-tabbar-item name="setting" icon="contact">用户</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import Home from "../components/home.vue";
import List from "../components/list.vue";
import ShoppingCart from "../components/shoppingCart.vue";
import UserLogin from "../components/userLogin.vue";
export default {
  components: {
    Home,
    List,
    ShoppingCart,
    UserLogin,
  },
  data() {
    return {
      active: "home",
      list: [
        // {
        //   id: "87ycx1S7464RaObX6V17",
        //   goodsName: "精选海南袖珍紫茄（水果番茄）1kg",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/18a63961476246c190be5a5b06079cf6.jpg",
        //   mallPrice: 19.8,
        //   retailPrice: 25.9,
        //   salePrice: 19.8,
        //   supplyPrice: 11.16,
        //   goodsBrand: "依谷",
        //   goodsUnit: "份",
        //   goodsStandard: "1kg",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "0",
        //   goodsClass: "040100106",
        //   insideKey:
        //     "精选紫番茄,紫番茄,番茄,圣女果,小西红柿,西红柿,番茄汁,番茄酱,新鲜水果,水果,生鲜,广西,国产水果",
        //   hits: 1120048,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/9a57eebf77fd4004b301223ba71e0fd2.jpg" /><img src="https://oss.egu365.com/upload/fce57a26a6e74ba8ba9f2d987dcf8d59.jpg" /><img src="https://oss.egu365.com/upload/aca5a62a7fe94b369c51843ae5dd7faa.jpg" /></p>\r\n',
        //   slogan: "小巧玲珑 生鲜水果 香甜宜人 果蔬两用 可制作水果沙拉",
        //   goodsBzq: "净重：1000g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "广西",
        // },
        // {
        //   id: "08Ay2Q2853y1V38b1pL7",
        //   goodsName: "墨西哥牛油果6个",
        //   goodsImg: "https://oss.egu365.com/upload/201504170947633055.jpg",
        //   mallPrice: 59.8,
        //   retailPrice: 89,
        //   salePrice: 59.8,
        //   supplyPrice: 38.63,
        //   goodsBrand: "依谷",
        //   goodsUnit: "盒",
        //   goodsStandard: "1000g",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "1",
        //   goodsClass: "040100208",
        //   insideKey:
        //     "墨西哥牛油果6个,墨西哥,牛油果,乳木果,乳油木,雪亚果,鳄梨,果子,果类,生鲜,果汁,维C,维生素C,进口水果,新鲜水果,水果",
        //   hits: 1120049,
        //   goodsDesc:
        //     '<div style="border-bottom-color:#808080; border-bottom-style:dashed; border-bottom-width:1px; font-size:14px; line-height:20px; padding-bottom:10px"><!--01--><img src="https://oss.egu365.com/upload/8b531c8c0cfd4cffb5b88be3eb2c67ba.jpg" /><img alt="" src="https://oss.egu365.com/upload/1463552340856.jpg" /> <img alt="" src="http://www.egu365.com/upload/2015-04-16/1429170638781.jpg" /> <img alt="" src="http://www.egu365.com/upload/2015-04-16/1429170644046.jpg" /> <img alt="" src="http://www.egu365.com/upload/2015-04-16/1429170649586.jpg" /> <img alt="" src="http://www.egu365.com/upload/2015-04-16/1429170654847.jpg" /> <img alt="" src="http://www.egu365.com/upload/2015-04-16/1429170660955.jpg" /> <img alt="" src="http://www.egu365.com/upload/2015-04-16/1429170683861.jpg" /> <img alt="" src="https://oss.egu365.com/upload/1463552468690.jpg" />\r\n<p>&nbsp;</p>\r\n<!--1--></div>\r\n\r\n<div style="border-bottom-color:#808080; border-bottom-style:dashed; border-bottom-width:1px; font-size:14px; line-height:20px; padding:10px">产品图片及描述内容仅做参考,请您以收到的商品实物为准,由此给您带来的不便敬请谅解,谢谢！</div>\r\n',
        //   slogan: "美味营养 健康之选",
        //   goodsBzq: "净重：约1000g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "墨西哥",
        // },
        // {
        //   id: "2iHQ5GI037h22O1B7212",
        //   goodsName: "云南特级枇杷1kg",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/e4e3e8ebd61643c8b321e579eeda3b90.jpg",
        //   mallPrice: 98.9,
        //   retailPrice: 129.8,
        //   salePrice: 98.9,
        //   supplyPrice: 60,
        //   goodsBrand: "依谷",
        //   goodsUnit: "盒",
        //   goodsStandard: "1kg",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "1",
        //   goodsClass: "040100100",
        //   insideKey: "云南特级枇杷1kg",
        //   hits: 1120053,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/e0b2d0d6af55495dbd3f37e0524068cc.jpg" /><img src="https://oss.egu365.com/upload/5im8fj3wo0wibern1qtoduiahmh6eobt.jpg" /><img src="https://oss.egu365.com/upload/lfzz5ydvqm2faapsw8lnkopledam6woc.jpg" /><img src="https://oss.egu365.com/upload/5uga6ssso3apaomzrtev9uqxs1ldy6v3.jpg" /><img src="https://oss.egu365.com/upload/y9wuki1pe3kywrbuzio5y5cwklrm8ihh.jpg" /><img src="https://oss.egu365.com/upload/72izpphceqlx9czt9zj5xs9s5yfps3ve.jpg" /><img src="https://oss.egu365.com/upload/mzsnfy6bh234putdb23uoggjj7osa8ai.jpg" /><img src="https://oss.egu365.com/upload/nwnjgpcf4mokaaix933btvx1agddnnyn.jpg" /><img src="https://oss.egu365.com/upload/ly4cuyzgeeuwrwzsteewkxo8hvefp8ex.jpg" /><img src="https://oss.egu365.com/upload/vtrb7k1g34bz2ejko1ffrogu6woctl8a.jpg" /></p>\r\n',
        //   slogan: "枇杷大果 果肉肥厚 清甜多汁 满口水润营养",
        //   goodsBzq: "净重：约1000g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "云南",
        // },
        // {
        //   id: "c5Q5SxE1vyNlei7Jt0C1",
        //   goodsName: "海南树上熟木瓜2个装(约1200g）",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/149be7af45f44a52bd2d8f3d6e36adf4.jpg",
        //   mallPrice: 19.8,
        //   retailPrice: 26,
        //   salePrice: 19.8,
        //   supplyPrice: 14.2,
        //   goodsBrand: "依谷",
        //   goodsUnit: "盒",
        //   goodsStandard: "2个装(约1200g)",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "0",
        //   goodsClass: "040100104",
        //   insideKey:
        //     "海南树上熟木瓜,木瓜,树上熟木瓜,瓜,瓜类,热带水果,新鲜水果,水果,生鲜,海南,国产水果",
        //   hits: 1210002,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/ff11ee888f87445b8b501bfead508483.jpg" /><img alt="" src="https://oss.egu365.com/upload/7df5c3d5f4854e05bf22a32d51076020.jpg" /> <img alt="" src="https://oss.egu365.com/upload/d4289a06482d44c392a25fee850bc8e8.jpg?index=???????2??" title="" /> <img alt="" src="https://oss.egu365.com/upload/4167682eea2243d1808dbb9b21dfba92.jpg" /> <img alt="" src="https://oss.egu365.com/upload/f890cbac6c1745a48f941533fe50b565.jpg" /> <img alt="" src="https://oss.egu365.com/upload/9172abc69fb441c28eb620ed338f95e0.jpg" /> <img alt="" src="https://oss.egu365.com/upload/b191d8bd3a8645e48781a03016a628d8.jpg" /> <img alt="" src="https://oss.egu365.com/upload/aba337e333a74ce9a5ef0b15498a0e82.jpg" /> <img alt="" src="https://oss.egu365.com/upload/4ab3e86c71ac4598aef47d0fd1982d0a.jpg" /> <img alt="" src="https://oss.egu365.com/upload/1494297495337.jpg" /> <img alt="" src="https://oss.egu365.com/upload/6429bca7e2fb43d1b0022415d78b6ae1.jpg" /></p>\r\n',
        //   slogan: "新鲜时令水果 树上熟 经典品质 饱含热带阳光的灿烂",
        //   goodsBzq: "净重：约1200g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "海南",
        // },
        // {
        //   id: "e50105fa16ef490c9b9f",
        //   goodsName: "菲律宾进口香蕉1.2kg",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/6892eca1a00b4eb5ac22290557b247cd.jpg",
        //   mallPrice: 19.8,
        //   retailPrice: 29.8,
        //   salePrice: 19.8,
        //   supplyPrice: 11.5,
        //   goodsBrand: "依谷",
        //   goodsUnit: "盒",
        //   goodsStandard: "1.2kg",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "0",
        //   goodsClass: "040100207",
        //   insideKey:
        //     "菲律宾进口香蕉,进口香蕉,进口芭蕉,香蕉,芭蕉,热带水果,新鲜水果,水果,生鲜,菲律宾,进口水果,一元换购,dt",
        //   hits: 1210005,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/0e4900411a17476eae96801703e1461a.jpg" /><img alt="" src="https://oss.egu365.com/upload/ccd99f39a33e4271a688a7366baa0530.jpg?index=???????1-2" title="" /> <img alt="" src="https://oss.egu365.com/upload/1497485575232.jpg" /> <img alt="" src="https://oss.egu365.com/upload/1497485582988.jpg" /></p>\r\n',
        //   slogan: "超甜进口香蕉 果皮易剥 软糯可口 人气水果 每天两根 健康满分",
        //   goodsBzq: "净重：1200g",
        //   goodsStore: "存储：常温/冷藏",
        //   address: "菲律宾",
        // },
        // {
        //   id: "B45287P0U1OY66b7lE2w",
        //   goodsName: "南非西柚3个装（约1100g）",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/bf311275ea634cb7b49b87051ef810b5.jpg",
        //   mallPrice: 19.8,
        //   retailPrice: 28,
        //   salePrice: 19.8,
        //   supplyPrice: 13,
        //   goodsBrand: "依谷",
        //   goodsUnit: "盒",
        //   goodsStandard: "3个装（约1100g）",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "0",
        //   goodsClass: "040100208",
        //   insideKey:
        //     "南非西柚,西柚,葡萄柚,柚子,柚,无籽,柚子汁,果汁,维C,维生素C,新鲜水果,水果,生鲜,南非,进口水果",
        //   hits: 1210009,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/8664772c1d9447c599bd259a1f189612.jpg" />&nbsp;<img src="https://oss.egu365.com/upload/dc3a0663885342acb9886b3957b16167.jpg" /><img src="https://oss.egu365.com/upload/8b212c288f5c4e1aafb9483587cd24c7.jpg" /><img src="https://oss.egu365.com/upload/45a7cf3577404486b6c4f7acf47ed861.jpg" /><img src="https://oss.egu365.com/upload/a3c7d6646919450792c98dcea4cc03ef.jpg" /><img src="https://oss.egu365.com/upload/3731e6c0b1c34eb6a3711ed12ad1dcca.jpg" /></p>\r\n',
        //   slogan: "新鲜进口 精选葡萄柚 果肉红润 酸爽过瘾 女士精选水果",
        //   goodsBzq: "净重：约1100g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "南非",
        // },
        // {
        //   id: "4Im2QV1L86YX2Kf3q4w7",
        //   goodsName: "广西脆柿6粒盒装",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/yi0ujbj8ywakvpply8oykwf7odspup9h.jpg",
        //   mallPrice: 18.1,
        //   retailPrice: 25,
        //   salePrice: 18.0,
        //   supplyPrice: 14,
        //   goodsBrand: "依谷",
        //   goodsUnit: "盒",
        //   goodsStandard: "1.25kg",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "1",
        //   goodsClass: "040100106",
        //   insideKey: "广西脆柿,柿子,脆柿子,广西柿子,国产水果,国产柿子",
        //   hits: 1210016,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/6103ee8617814fa5a1c6e4f2a4f47a63.jpg" /><img src="https://oss.egu365.com/upload/ckn4gwtzoa175oggoaviffoskkttdqex.jpg" /><img src="https://oss.egu365.com/upload/3lqtssq32nnkhzxzhtdpzgcpwm9nj2za.jpg" /><img src="https://oss.egu365.com/upload/j7prxlt77momuf3wnm6fvipqdu5mfmz0.jpg" /><img src="https://oss.egu365.com/upload/evnvccvdabpz9nuqsu8epsfxfxvogn48.jpg" /><img src="https://oss.egu365.com/upload/utunnvrfzbmfp6muemb3ypte4t45196c.jpg" /><img src="https://oss.egu365.com/upload/kjv1obggv2w4e6iqz9bkzvfayzwaegzx.jpg" /></p>\r\n',
        //   slogan: "含有丰富的糖分 果胶 维生素",
        //   goodsBzq: "净重：约1250g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "广西",
        // },
        // {
        //   id: "0d0de48354564f91b77c",
        //   goodsName: "美国进口加力果8个装(约1350g)",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/4cd26929ab894d90b77311aeec98a26c.jpg",
        //   mallPrice: 69.8,
        //   retailPrice: 109,
        //   salePrice: 69.8,
        //   supplyPrice: 43.3,
        //   goodsBrand: "依谷",
        //   goodsUnit: "份",
        //   goodsStandard: "8个装",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "0",
        //   goodsClass: "040100201",
        //   insideKey:
        //     "美国加力果,加力果,进口小苹果,进口苹果,进口加力果,小苹果,苹果,苹果汁,果汁,红苹果,平安果,维C,维生素C,新鲜水果,水果,生鲜,进口水果,圣诞节,圣诞",
        //   hits: 1210020,
        //   goodsDesc:
        //     '<p><img alt="" src="https://oss.egu365.com/upload/7ca3338cb74e40dc84c610a97c2201bb.jpg" /><img src="https://oss.egu365.com/upload/jfeetacfauet1mupva5o1ehyirbqozih.png" /><img src="https://oss.egu365.com/upload/bxcphlsn5jqp6ryt5fve9ep6cmpma9y1.png" /><img src="https://oss.egu365.com/upload/coqfrgudv8ih0szbfjwlihv7sdeewza4.png" /><img src="https://oss.egu365.com/upload/jfisst5uyaoie3xoke5xjfxdji9xydif.jpg" /></p>\r\n',
        //   slogan: "皮薄肉脆 又甜又多汁 天然果香 感受自然之美",
        //   goodsBzq: "净重：约1350g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "美国",
        // },
        // {
        //   id: "58a9911f6d424625a18b",
        //   goodsName: "越南红心火龙果3个装（约2kg）",
        //   goodsImg:
        //     "https://oss.egu365.com/upload/94eee085472a477887d838ea60c81b28.jpg",
        //   mallPrice: 56.8,
        //   retailPrice: 69,
        //   salePrice: 56.8,
        //   supplyPrice: 34.32,
        //   goodsBrand: "依谷",
        //   goodsUnit: "份",
        //   goodsStandard: "3个装",
        //   minStripping: "1",
        //   scarce: "0",
        //   goodsType: 0,
        //   publishType: "000",
        //   filter: "0",
        //   goodsClass: "040100207",
        //   insideKey:
        //     "越南进口红心火龙果,进口火龙果,火龙果,红心,红心火龙果,花青素,礼盒,礼箱,水果礼盒,节日送礼,礼品,新鲜水果,水果,生鲜,越南,进口水果,dt",
        //   hits: 1210023,
        //   goodsDesc:
        //     '<p><img src="https://oss.egu365.com/upload/ef3354cfd6fd4ffb83330318957acf77.jpg" /><img alt="" src="https://oss.egu365.com/upload/922c9b7b78f442069293560023554130.jpg" /><img alt="" src="https://oss.egu365.com/upload/ef3d45fe257e4f4da9d514cdfbe9ae4b.jpg?index=???????3??" title="" /><img alt="" src="https://oss.egu365.com/upload/c549ccfba0244686bee52097184df6ba.jpg" /><img alt="" src="https://oss.egu365.com/upload/a48ca00df027410baaa54d6bdd1fde15.jpg" /><img alt="" src="https://oss.egu365.com/upload/fdaabba5959945798cc1a6643fc9d2e9.jpg" /><img alt="" src="https://oss.egu365.com/upload/2daa0014cafd4b078562cf8626328ec2.jpg" /><img alt="" src="https://oss.egu365.com/upload/99a9ca258071400ab8928132f64696ef.jpg" /><img alt="" src="https://oss.egu365.com/upload/cdb4907ee6bc4bc1a24c0ee820a84fb6.jpg" /><img alt="" src="https://oss.egu365.com/upload/af73c1af909a4994a1d49d166ac4a4b0.jpg" /></p>\r\n',
        //   slogan: "红肉 越南直采鲜果 果肉更足 享受更甜蜜饱满的口感",
        //   goodsBzq: "净重：约2000g",
        //   goodsStore: "存储：冷藏（0-4℃）",
        //   address: "越南",
        // },
      ],
    };
  },
  mounted() {
    sessionStorage.setItem("list", JSON.stringify(this.list));
    if (JSON.parse(sessionStorage.getItem("active"))) {
      this.active = JSON.parse(sessionStorage.getItem("active"));
    }
  },
  methods: {
    onChange(item) {
      console.log(item);
      sessionStorage.setItem("active", JSON.stringify(item));
    },
  },
};
</script>
<style scoped  lang="scss">
// .guangxi_appointment {
// }
</style>